package com.fansl.allround.wechat.mp.error;

import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.ErrorPageRegistrar;
import org.springframework.boot.web.server.ErrorPageRegistry;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;

/**
 * @author fansl
 * @Description: 配置错误状态与对应访问路径
 * @date 2019/9/6 15:34
 */
@Component
public class ErrorPageConfiguration implements ErrorPageRegistrar {

    @Override
    public void registerErrorPages(ErrorPageRegistry registry) {
        registry.addErrorPages(
            new ErrorPage(HttpStatus.NOT_FOUND,"/error/4O4"),
            new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR,"/error/500")
        );
    }
}
